Supporting Multiple Languages

in a Liberty Basic Application

© 2005, Brad Moore

LB Connection

Home

Save As w/o Save

Working with Strings

Stylebits Corner

Eddie's Lessons, v8

Multiple Languages

Speech for Disabled

File Searcher

Newsletter help

Index


Multi-Language Support for your application

There has been so recent interest in implementing a multiple language feature for a give application in Liberty Basic. At least two recent discussions have sprung up around the topic on the LB Forum.

There are several ways of approaching this including the option of using Microsoft's own internationalization features. For most LB programmers this will be beyond the scope of their project.

An easy to implement a feature like this (and one chosen by most programmers) is to building all your dialog strings and communications with the user in a language file. Each message has it's own id and that is associated with a specific text string in a language file. If you want to support multiple languages then you create a separate file for each language containing the messages in that language. Additional language files would add additional languages your program would support natively.

Load the default language messages into an array of messages. If the user chooses another language, then load the new set of message files into the same array effectively changing the language in use.

You might consider writing an INI file entry that holds the users preferred language setting. You could load that setting each time the program starts and then have the program running in the correct language.

I have created an example of this approach with a slight twist. The messages for each language are contained in a single comma delimited file. You can see this in action in the file Shopping.zip that is included with this newsletter download.

Note: My apologies to native German and Spanish speakers. I am neither (I am barely a native English speaker). I used BableFish [http://babelfish.altavista.com/] for my translations.


Home

Save As w/o Save

Working with Strings

Stylebits Corner

Eddie's Lessons, v8

Multiple Languages

Speech for Disabled

File Searcher

Newsletter help

Index